package com.xmtlxx.wms.mapper;

import com.xmtlxx.common.annotation.DataColumn;
import com.xmtlxx.common.annotation.DataPermission;
import com.xmtlxx.common.core.mapper.BaseMapperPlus;
import com.xmtlxx.wms.domain.Warehouse;
import com.xmtlxx.wms.domain.bo.WarehouseBo;
import com.xmtlxx.wms.domain.vo.WarehouseVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 入库单Mapper接口
 *
 * @author xmtlxx
 * @date 2022-08-15
 */
public interface WarehouseMapper extends BaseMapperPlus<WarehouseMapper, Warehouse, WarehouseVo> {
    /**
     * 根据条件分页查询入库单
     *
     * @param warehouse 入库单
     * @return Page Warehouse
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "w.create_by"),
        @DataColumn(key = "deptName", value = "w.dept_id"),
        @DataColumn(key = "userName", value = "w.create_by")
    })
    Page<WarehouseVo> selectPageWarehouseList(@Param("page") Page<Warehouse> page,@Param("warehouse") WarehouseBo warehouse);

    /**
     * 查询入库单列表
     *
     * @param warehouse 入库单
     * @return 入库单集合
     */
    @DataPermission({
        @DataColumn(key = "tenantName", value = "w.create_by"),
        @DataColumn(key = "deptName", value = "s.dept_id"),
        @DataColumn(key = "userName", value = "w.create_by")
    })
    List<WarehouseVo> selectWarehouseList(@Param("warehouse") WarehouseBo warehouse);

    WarehouseVo selectWarehouseVoByID(String id);

    WarehouseVo selectWarehouseVoByTaskId(String taskId);

    Warehouse selectWarehouseByTaskId(String taskId);

    int updateWarehouse(@Param("warehouse") Warehouse warehouse);

    void removeWarehouse(String id);
}
